Skip to content

fix: FC43 trace, reload between requests, bounded shutdown, control API checks and input validation (v1.6.0) - #25

Merged
boeboe merged 1 commit into
mainfrom
fix/policy-1.6-review
Nov 15, 2026
Merged

boeboe merged 1 commit into
mainfrom
fix/policy-1.6-review

Conversation

@boeboe

@boeboe boeboe commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Implements the policy 1.6 review of modbus-simulator. The behaviour changes are listed under ### Breaking in RELEASE.md (v1.6.0), each with how to restore the old behaviour.

What changes:

  • FC43: an individual read of an object id that the fixture does not configure is traced as ok: false, illegal_data_address, as the client receives it. Identity values are limited to 244 bytes (UTF-8), the most one response carries, in the schema and in semantic validation.
  • A reload takes effect between two requests: a request whose rules were applied before a reload and that takes effect after it is answered from the new fixture (store generations; the checks run again under the commit lock).
  • run shuts down within 10 s (control API, then the Modbus server, one bound), waits for the control API goroutine, and exits with code 4 when requests are still in progress. A second SIGINT or SIGTERM ends the process.
  • The first trace write error is reported while running: one warning line on stderr, and /healthz answers 503 with the error.
  • The control API refuses requests that carry an Origin header (403) and closes idle keep-alive connections after 30 s.
  • Validation: a float32 codec value beyond the float32 range is refused; an environment variable that does not parse is a usage error (exit 2) naming it; an expectation matcher may name only trace fields (exit 3 otherwise).
  • Tests: the shutdown stress test waits for events and counts the records; a goroutine leak check (internal/leakcheck) runs after the tests of internal/simulator and cmd; make fuzz discovers its targets; CI regenerates the codec examples and fails on a difference (make generate-check, job Generated codec examples).
  • SECURITY.md lists the resource limits with their values.

Files: internal/simulator/{handler,store,server,control,validate,codecfield}.go, schemas/{fixture,expect}-v1.json, cmd/{root,run}.go, internal/leakcheck/, tests in internal/simulator and cmd, Makefile, .github/workflows/ci.yml, README.md, REQUIREMENTS.md, ARCHITECTURE.md, SECURITY.md, TESTING.md, RELEASE.md.

Tests: new regression tests for every change, each shown to fail with its fix removed; the concurrency and shutdown tests pass with -race -count=20; make check, make soak, make fuzz and make generate-check pass; otfabric-policy is compliant.

Checks

  • make check (vet, golangci-lint, govulncheck, the race tests, coverage), make soak (2 min), make fuzz (30 s, three targets) and make generate-check pass; the policy checker is compliant.
  • Not run here: the Windows tests and the 32-bit case of the environment-variable test (both compile only); CI runs them.

🤖 Generated with Claude Code

…PI checks and input validation (v1.6.0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boeboe
boeboe merged commit f73d633 into main Nov 15, 2026
14 checks passed
@boeboe
boeboe deleted the fix/policy-1.6-review branch November 15, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant